import Vue from 'vue'
import VueRouter from 'vue-router'
import NotFound from '../pages/errorPage/403.vue';
import Forbidden from '../pages/errorPage/404.vue';
import Home from '../pages/home/index.vue';
import Layout from '../pages/layout/index.vue';
import Login from '../pages/login/index.vue';


Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]

export const DynamicRouts = [
  {
    path: '/',
    name: 'container',
    component: Layout,
    redirect: '/home',
    meta: {
      requiresAuth: true,
      name: '首页'
    },
    children: {
      path: '/home',
      name: 'home',
      component: Home,
      meta: {
        icon: 'icon-name',
        name: '首页'
      }
    }
  },
  {
    path: '/403',
    component: Forbidden,
  },
  {
    path: '/*',
    component: NotFound,
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
